class IterableClass:

    def __iter__(self):
        self.licznik = 0
        return self

    def __next__ (self):
        if self.licznik >= 10:
            raise StopIteration
        self.licznik += 1
        return self.licznik

 
obj = IterableClass()
obj = iter(obj)

print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
print obj.__next__()
